﻿@using HotelMgr.Helpers
@model HotelMgr.Models.Notice
@{
    ViewBag.Title = "Index"; Layout = null;
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<h2>@Model.NoticeTitle</h2>
<p class="detail">@Html.Truncate(Model.NoticeContent,92) <a href="javascript:;" title="查看公告详细" id="btnNoticeDetails"style="color: red;">[详细]</a></p>
<p class="time">@String.Format("{0:yyyy-MM-dd}",Model.AddDate)</p>
<div id="dialogNotice" title="公告详情" style="display:none;">
    <p style="text-indent:2em;">@Model.NoticeContent</p>
    <p style="text-align:right;"><br />@Model.AddDate.ToString("yyyy-MM-dd")</p>
</div>
@{
    Html.Telerik().Window()
        .Name("windowNotice").Title("公告详情")
        .Width(350).Height(200)
        .Buttons(b=>b.Refresh().Maximize().Close())
        .Draggable(true).Scrollable(true)
        .Content(@<text>
                    <p style="text-indent:2em;">@Model.NoticeContent</p>
                    <p style="text-align:right;"><br />@Model.AddDate.ToString("yyyy-MM-dd")</p>
                  </text>)
        .Visible(false).Resizable()
        .Render();
}
<script type="text/javascript">
        $("#btnNoticeDetails").click(function(){
            var window = $("#windowNotice").data("tWindow");
            window.center();
            window.open();
        });

        function windowNoticeClose() {
            var window = $("#windowNotice").data("tWindow");
            window.close();
  
        }
    
</script>